package com.itljm.cxrMarket.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itljm.cxrMarket.entity.CarouselImages;
import com.itljm.cxrMarket.service.CarouselImagesService;
import com.itljm.cxrMarket.mapper.CarouselImagesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarouselImagesServiceImpl extends ServiceImpl<CarouselImagesMapper, CarouselImages> implements CarouselImagesService{
    @Autowired
    private CarouselImagesMapper carouselImagesMapper;

    @Override
    public List<CarouselImages> selectCarouselImagesByPage(Page<CarouselImages> page, QueryWrapper<CarouselImages> wrapper) {
        return carouselImagesMapper.selectCarouselImagesByPage(page, wrapper);
    }

    @Override
    public CarouselImages selectCarouselImagesById(Integer id) {
        return carouselImagesMapper.selectById(id);
    }

    @Override
    public boolean addOrUpdateCarouselImages(CarouselImages carouselImages) {
        return carouselImagesMapper.insertOrUpdate(carouselImages);
    }


    @Override
    public boolean deleteCarouselImagesById(Integer id) {
        return carouselImagesMapper.deleteById(id) > 0;
    }
}




